The Significance of Method Parameters and Local Variables as Beacons for Comprehension: An Empirical Study

نویسنده

  • Eran Avidan
چکیده

It is widely accepted that meaningful variable names are important for comprehension. We claim that not all variables are equally significant to the process of code comprehension. We conducted a controlled experiment in which 9 professional developers try to understand 6 methods from production util classes, either with the original variable names or with names replaced by meaningless single letters. In our experiments, we have masked all the methods names. One group of subjects was presented with 3 different versions of the code in the following order: all variable names replaced by single letters, only parameters names or local variables replaced by single letters, and all the original variable names. We then compared the time it took them to resolved the method functionality to a different group who received the method with the original variable names revealed from the beginning. During the experiments we communicated with the subjects and used the thinking aloud technique in order to get a better understanding of each developer’s thinking process. This helped us determine, among other things, which of the variables were more beneficial to their understanding of the methods. Results show that parameter names are more significant for comprehension then local variables, as 80% of the subjects indicated that parameters where more beneficial then locals regardless of the order the variable names were revealed. Replicating previous work on identifier naming, we can also reconfirms that names have a large impact on the comprehension of code. In half of the methods there was a statistically significant difference between the time it took each group to reach an understanding of the method, were it took less time for the subjects who were presented with the method and its original variable names. Surprisingly, the other three of the six methods we used turned out to have problematic names. In fact, they demonstrated that misleading names are worse than meaningless names like consecutive letters of the alphabet, and can lead to errors in comprehension. But these names were not meant to be misleading. This reflects the subjective nature of naming, where a name that one developer thinks is meaningful can be misleading for another developer. Considering the way these methods were chosen, and the fact that they were extracted from real production code, suggests that it is a not uncommon phenomenon. We believe that this highlights the need for additional research on how variable names are interpreted and how better names can be chosen.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Automatic Algorithm Recognition Based on Programming Schemas and Beacons - A Supervised Machine Learning Classification Approach

Aalto University, P.O. Box 11000, FI-00076 Aalto www.aalto.fi Author Ahmad Taherkhani Name of the doctoral dissertation Automatic Algorithm Recognition Based on Programming Schemas and Beacons: A Supervised Machine Learning Classification Approach Publisher Aalto University School of Science Unit Department of Computer Science and Engineering Series Aalto University publication series DOCTORAL ...

متن کامل

Prediction of scour dimension in the Plunge Pools below Outlet Bucket with Artificial intelligence method

Accurate prediction of sediment scour hole dimensions downstream of hydraulic structures, e.g. the outlet bucket, is a complex and not straight forward engineering problem encountered worldwide. Because of the complexities of the study, its comprehensive, simultaneous including water flow,  sediment and applying all of the effective variables involved in scouring it is not easy possible. Dimens...

متن کامل

Design of Riprap Stone Around Bridge Piers Using Empirical and Neural Network Method

An attempt was made to develop a method for sizing stable riprap around bridge piers based on a huge amount of experimental data, which is available in the literature. All available experimental data for circular as well as round-nose-and-tail rectangular piers were collected. The data for rectangular piers, with different aspect ratios, aligned with the flow or skewed at different angles to th...

متن کامل

Code Scanning Patterns in Program Comprehension

Various publications have identified Beacons to play a key role in program comprehension. Beacons are code fragments that help developers comprehend programs. It has been shown that expert programmers pay more attention to Beacons than novices. Beacons are described as the link between source code and hypothesis verification. Beacons are sets of key features that typically indicate the presence...

متن کامل

ESP Instruction: Traditional vs. Eclectic Method in Relation to Reading Comprehension of Iranian Agriculture Students

This study aimed at finding out the effect of two different methods of ESP instruction, namely, the traditional grammar translation method and an eclectic method on improving university students' reading comprehension ability. The main assumption was that compared to the Grammar-Translation which is probably not an efficient method, an eclectic method that focuses on improving reading comprehen...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2016